Problem: function GenerateIntegers() { var len, integers; do { // generate random list of numbers len = KhanUtil.randRange( 5, 10 ); integers = []; for (var i = 0; i < len; i++) { integers[i] = KhanUtil.randRange( 1, 10 ); } } while ( !KhanUtil.mode(integers) ); return integers; } function DisplayMedian( sortedInts ) { var si = sortedInts.slice(0), center = Math.floor( si.length / 2 ), prepend = "\\boldsymbol{", append = "}"; if ( si.length % 2 == 0 ) { si[center] = prepend + si[center] + append; si[center - 1] = prepend + si[center - 1] + append; } else { si[center] = prepend + si[center] + append; } return si.join( ", " ); } What is the median of the following numbers? $6, 2, 10, 8, 8, 6, 7, 8, 4, 10$
Answer: First, order the numbers, giving: $2, 4, 6, 6, 7, 8, 8, 8, 10, 10$ Since we have $2$ middle numbers, the median is the mean of those two numbers! $2, 4, 6, 6, \boldsymbol{7}, \boldsymbol{8}, 8, 8, 10, 10$ The median is $\dfrac{7 + 8}{2}$ So the median is $\dfrac{15}{2}$. Another way to find the middle number is to draw the numbers on a number line. If a number appears multiple times, count its corresponding dot multiple times. ${0}$ ${1}$ ${2}$ ${3}$ ${4}$ ${5}$ ${6}$ ${7}$ ${8}$ ${9}$ ${10}$ $\scriptsize{2}$ $\scriptsize{3}$ $\scriptsize{2}$